package com.wcs.exam.controller.admin.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * Admin-试卷信息-保存请求参数
 * </p>
 *
 * @author wcs
 * @since 2025-03-11
 */
@Getter
@Setter
@Accessors(chain = true)
@Schema(description = "Admin-试卷信息-保存请求参数")
public class AdminPaperSaveReq implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "试卷类型不能为空")
    @Schema(description = "试卷类型(1:普通试卷、2:题库试卷)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer paperType;

    @Size(max = 100, message = "试卷名称不能超过100个字符")
    @NotBlank(message = "试卷名称不能为空")
    @Schema(description = "试卷名称(内容限制：1~100)", requiredMode = Schema.RequiredMode.REQUIRED)
    private String paperName;

    @NotNull(message = "分类ID不能为空")
    @Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long categoryId;

    @Min(value = 1, message = "答卷时间不能小于1分钟")
    @Max(value = 360, message = "答卷时间不能超过360分钟")
    @NotNull(message = "答卷时间不能为空")
    @Schema(description = "答卷时间(单位：分钟，取值范围：1~360)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer answerTime;

    @Min(value = 0, message = "及格分数不能小于0")
    @Max(value = 100, message = "及格分数不能超过100")
    @NotNull(message = "及格百分比不能为空")
    @Schema(description = "及格百分比(取值范围：0~100)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer passPercentage;

    @Schema(description = "随机组题设置(false:关闭、true:开启)-默认：false")
    private Boolean randomCombine;

    @Schema(description = "乱序设置(false:关闭、true:开启)-默认：false")
    private Boolean derangement;

    @Schema(description = "题目乱序(false:关闭、true:开启)-默认：false")
    private Boolean questionDerangement;

    @Schema(description = "选项乱序(false:关闭、true:开启)-默认：false")
    private Boolean optionDerangement;

    @Schema(description = "发布状态(0:未发布，1:已发布)--默认：未发布")
    private Integer publishStatus;
}
